package com.xishu.bo.printer;

import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

public class PrinterItem implements Serializable {
    private static final long serialVersionUID = -4481199724737273344L;

    @ApiModelProperty(value = "长度")
    private int length;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "打印的顺序,从1开始")
    private int index;

    @ApiModelProperty(value = "可能会显示多行")
    private Boolean maybeMultiLine = false;

    @ApiModelProperty(value = "是否加粗")
    private Boolean bold;

    @ApiModelProperty(value = "居中对齐")
    private Boolean center;

    @ApiModelProperty(value = "右对齐")
    private Boolean right;

    @ApiModelProperty(value = "是否是LOGO图片")
    private Boolean logo;

    @ApiModelProperty(value = "是否是条形码")
    private Boolean barCode;

    @ApiModelProperty(value = "是否是二维码")
    private Boolean qrCode;

    @ApiModelProperty(value = "加大一倍显示")
    private Boolean doubleShow;

    @ApiModelProperty(value = "前面空多少个空格")
    private int prefixLength;

    @ApiModelProperty(value = "X轴双倍")
    private Boolean xDouble;

    @ApiModelProperty(value = "X轴双倍")
    private Boolean yDouble;

    @ApiModelProperty(value = "换行之后留多少个空格")
    private int newLinePrefix;

    public int getNewLinePrefix() {
        return newLinePrefix;
    }

    public void setNewLinePrefix(int newLinePrefix) {
        this.newLinePrefix = newLinePrefix;
    }

    public Boolean getxDouble() {
        return xDouble;
    }

    public void setxDouble(Boolean xDouble) {
        this.xDouble = xDouble;
    }

    public Boolean getyDouble() {
        return yDouble;
    }

    public void setyDouble(Boolean yDouble) {
        this.yDouble = yDouble;
    }

    public int getPrefixLength() {
        return prefixLength;
    }

    public void setPrefixLength(int prefixLength) {
        this.prefixLength = prefixLength;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public String getContent() {
        if (content == null) {
            return "";
        }
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public Boolean getMaybeMultiLine() {
        return maybeMultiLine;
    }

    public void setMaybeMultiLine(Boolean maybeMultiLine) {
        this.maybeMultiLine = maybeMultiLine;
    }

    public Boolean getBold() {
        return bold;
    }

    public void setBold(Boolean bold) {
        this.bold = bold;
    }

    public Boolean getCenter() {
        return center;
    }

    public void setCenter(Boolean center) {
        this.center = center;
    }

    public Boolean getRight() {
        return right;
    }

    public void setRight(Boolean right) {
        this.right = right;
    }

    public Boolean getLogo() {
        return logo;
    }

    public void setLogo(Boolean logo) {
        this.logo = logo;
    }

    public Boolean getBarCode() {
        return barCode;
    }

    public void setBarCode(Boolean barCode) {
        this.barCode = barCode;
    }

    public Boolean getQrCode() {
        return qrCode;
    }

    public void setQrCode(Boolean qrCode) {
        this.qrCode = qrCode;
    }

    public Boolean getDoubleShow() {
        return doubleShow;
    }

    public void setDoubleShow(Boolean doubleShow) {
        this.doubleShow = doubleShow;
    }

    /**
     * 产生一个配置一样的元素，只是内容不一样
     *
     * @return
     */
    public PrinterItem clone() {
        PrinterItem printerItem = new PrinterItem();
        BeanUtils.copyProperties(this, printerItem);
        return printerItem;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("PrinterItem{");
        sb.append("length=").append(length);
        sb.append(", content='").append(content).append('\'');
        sb.append(", index=").append(index);
        sb.append(", maybeMultiLine=").append(maybeMultiLine);
        sb.append(", bold=").append(bold);
        sb.append(", center=").append(center);
        sb.append(", right=").append(right);
        sb.append(", logo=").append(logo);
        sb.append(", barCode=").append(barCode);
        sb.append(", qrCode=").append(qrCode);
        sb.append(", doubleShow=").append(doubleShow);
        sb.append(", prefixLength=").append(prefixLength);
        sb.append(", xDouble=").append(xDouble);
        sb.append(", yDouble=").append(yDouble);
        sb.append(", newLinePrefix=").append(newLinePrefix);
        sb.append('}');
        return sb.toString();
    }
}
